package com.lh.java.structure;


/**链表实现
 * @author lenovo
 *
 */
public class StackLink {
	private class Node {
		Object item;
		Node next;

		Node(Object item, Node next) {
			this.item = item;
			this.next = next;
		}
	}

	private Node head;   
	public StackLink(Object maxN){
		head = null;		
	}

	boolean isEmpty() {
		return (head == null);
	}

	void push(Object item) {
		head = new Node(item, head);
	}

	Object pop() {
		Object v = head.item;
		Node t = head.next;
		head = t;
		return v;
	}

	
}
